package com.dayilyword.controller;

import com.dayilyword.service.BaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("index")
@Api(tags = "主页")
public class DiscoveryController {
    @Autowired
    BaseService baseService;

    @Autowired
    @Resource(name = "redis1")
    private StringRedisTemplate redis1;

    @GetMapping()
    @ApiOperation("测试接口")
    public String get() {
        return "dayilyWord";
    }

    @GetMapping(value = "/setRedis")
    @ApiOperation("setRedis")
    public void setRedis() {
        redis1.opsForValue().set("com.cs.d1", "1");
    }
}
